package com.xzakota.minesweeper.msg;

/**
 * 用户退出房间消息
 *
 * @author Xzakota
 */
public class UserExitRoomMsg extends RoomMsg {
    @Override
    public String getTag() {
        return "用户退出房间消息";
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder(getTag() + ": ");
        if (code == MsgCode.BASE_UNKNOWN) {
            sb.append(getUser().username).append(" 请求退出房间 ").append(getRoomNum());
        } else {
            sb.append(getUser().username).append(" 已退出房间 ").append(getRoomNum());
        }

        return sb.toString();
    }
}
